package cn.edu.gsau.info.controller;

import cn.edu.gsau.info.models.Code;
import cn.edu.gsau.info.models.ResponseResult;
import cn.edu.gsau.info.service.IZhengmingcailiaoService;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: gsau
 * @BelongsPackage: cn.edu.gsau.info.controller
 * @Author: kql
 * @CreateTime: 2022-11-25  14:58
 * @Description: TODO
 * @Version: 1.0
 */
@RestController
@RequestMapping("/cailiao")
@JsonSerialize(using = ToStringSerializer.class)
public class ZhengmingcailiaoController {
    @Autowired
    IZhengmingcailiaoService zhengMingCaiLiaoService;

    @DeleteMapping("/delete/{id}")
    public ResponseResult delete(@PathVariable long id){
        boolean b = zhengMingCaiLiaoService.removeById(id);
        return new ResponseResult(Code.DELETE_OK,"success",b);
    }

}
